package com.tingyukeji.fastpay.shop.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.view.View;

import com.tingyukeji.fastpay.R;
import com.tingyukeji.fastpay.base.BaseActivity;
import com.tingyukeji.fastpay.base.BaseRecyclerAdapter;
import com.tingyukeji.fastpay.databinding.ShopCarActivityBinding;
import com.tingyukeji.fastpay.shop.adapter.ShopCarAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/11/11.
 */

public class ShopCarActivity extends BaseActivity implements View.OnClickListener {
    private ShopCarActivityBinding binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void setContentView() {
        super.setContentView();
        binding = DataBindingUtil.setContentView(this, R.layout.shop_car_activity);
    }

    @Override
    protected void initView() {
        super.initView();
    }

    private void initOnlineStore() {
        List<Integer> commList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            commList.add(i);
        }
        GridLayoutManager gridLayoutManager = new GridLayoutManager(ShopCarActivity.this,1,GridLayoutManager.VERTICAL,false){
            @Override
            public boolean canScrollVertically() {
                // 直接禁止垂直滑动
                return false;
            }
        };
        binding.shopCarRecyclerview.setLayoutManager(gridLayoutManager); //给RecyClerView 添加设置好的布局样式
        ShopCarAdapter shopCarAdapter = new ShopCarAdapter(commList,context,false); //初始化适配器
        binding.shopCarRecyclerview.setAdapter(shopCarAdapter); // 对 recyclerview 添加数据内容
        shopCarAdapter.setOnItemClickListener(new BaseRecyclerAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(View itemView, int pos) {
//                goActivity(ShopDetailActivity.class);
            }
        });
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ic_bill:
                break;
            case R.id.rl_select_bank:
                break;
        }
    }

}
